// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import TypeNav from'@/components/TypeNav'//三级联动组件，引入注册为全局组件
import '../static/reset.css'//清除默认样式
import store from '@/store/index'//引入仓库即VueX
//引入MockServer.js----mock数据
import "@/mock/mockServe.js";
import '../static/iconfont/iconfont.css'//引入阿里图标样式
import Pagination from '@/components/Pagination'//分页器

//引入表单校验插件
import "@/plugins/validate";

//统一接口api文件夹里面全部请求函数
import * as API from '@/api';

//element组件库
import { Button,MessageBox} from 'element-ui';


//注册全局组件
Vue.component('TypeNav',TypeNav)
Vue.component("Pagination",Pagination)
Vue.component(Button.name, Button);

//ElementUI注册组件的时候，还有一种写法，挂在原型上
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>',
  store,
  beforeCreate () {
    Vue.prototype.$bus=this,
    Vue.prototype.$API=API
  },
})
